<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="no.ntnu.tdt4237.*" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Activate user account</title>
</head>
<body>
<%
	if(request.getParameter("username") == null || request.getParameter("code") == null) {
		%>
		<tags:error errorMsg="Nothing to see on this page!"></tags:error>
		<%
	}
	else {
		boolean success = Database.validateActivation(request.getParameter("username"), request.getParameter("code"));; //Do something
		if(success) {
			%>
			<tags:error errorMsg="Your account was activated!"></tags:error>
			<a href="login.jsp">Log in!</a>
			<%
		}
		else {
			%>
			<tags:error errorMsg="Your account was NOT activated!"></tags:error>
			<%
		}
	}
%>
</body>
</html>